package com.jia.leetCode;

/**
 * @program: Leetcode
 * @description:
 * @author: STU756
 * @create: 2020-08-09 10:37
 */
public class Pro5468 {
    public int findKthPositive(int[] arr, int k) {
        int start = 1;
        for(int i = 0; i < arr.length; i++) {
            while(start < arr[i]){
                --k;

                if(k == 0) {
                    return start;
                }
                ++start;
            }
            ++start;
        }
        return start + k-1;
    }
}
